<%@ page language="java" contentType="text/html; charset=UTF-8"
		 pageEncoding="UTF-8"%>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<%

	String path = request.getContextPath();

	String basePath = request.getScheme()+"://"+

			request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<script type="text/javascript" src="<%=basePath%>static/js/jquery-1.11.3.min.js"></script>
	<title>Insert title here</title>
</head>
<body>
主页面
<shiro:hasAnyRoles name="admin,manager,teacher,student">
	<a href="">查看学生</a>
</shiro:hasAnyRoles>


<shiro:hasAnyRoles name="admin,manager">
	<a href="#">查看老师</a>
</shiro:hasAnyRoles>

<shiro:hasAnyRoles name="admin,manager">
	<a href="#">修改学生</a>
</shiro:hasAnyRoles>

<shiro:hasAnyRoles name="admin,manager">
	<a href="#">删除学生</a>
</shiro:hasAnyRoles>

<shiro:hasAnyRoles name="admin">
	<a href="" onclick="deleteTeacher()">删除老师</a>
</shiro:hasAnyRoles>


<a href="" onclick="deleteTeacher()">删除老师</a>


<script>
	function deleteTeacher() {
		$.ajax({
			url:"<%=basePath%>teacher/delete",
			type:"GET",
			success:function (data) {
				if(data.message=="success"){
					alert("删除成功")
				}else if(data.message=="fail"){
					alert("删除失败")
				}else{
					location.href = "<%=basePath%>sys/error";
				}
			},
			error:function () {
				alert("服务器出错!")
			}
		})
	}

</script>
</body>
</html>